#include<stdio.h>
#include<unistd.h>

int main()
{
    //execl函数
    printf("程序替换前,you can see me\n");
    int ret=execl("/usr/bin/ls","ls","-a","-l",NULL);

    //程序替换多发生于子进程，也可以通过子进程的退出码来判断是否替换成功
    if(ret==-1)
        printf("程序替换失败！\n");

    printf("程序替换后,you can see me again?\n");
    return 0;
}
